<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="KeyinTree" targetNamespace="http://www.bentley.com/schemas/1.0/McroStation/AddIn/KeyinTree.xsd" elementFormDefault="qualified" xmlns="http://www.bentley.com/schemas/1.0/MicroStation/AddIn/KeyinTree.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:complexType name="Keyword">
    <xs:sequence>
      <xs:element name="Options" maxOccurs="1" minOccurs="0">
        <xs:complexType>
          <xs:attribute name="Required"   type="xs:boolean" default="false" use="optional" />
          <xs:attribute name="Default"    type="xs:boolean" default="false" use="optional" />
          <xs:attribute name="TryParse"   type="xs:boolean" default="false" use="optional" />
          <xs:attribute name="Hidden"     type="xs:boolean" default="false" use="optional" />
          <xs:attribute name="Immediate"  type="xs:boolean" default="false" use="optional" />
          <xs:attribute name="CmdString"  type="xs:int"     default="0"     use="optional" />
        </xs:complexType>
      </xs:element>
    </xs:sequence>
    <xs:attribute name="SubtableRef" type="xs:IDREF" />
    <xs:attribute name="CommandClass" use="optional" default="Inherit">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="Inherit" />
          <xs:enumeration value="Placement" />
          <xs:enumeration value="Viewing" />
          <xs:enumeration value="Fence" />
          <xs:enumeration value="Parameters" />
          <xs:enumeration value="Locks" />
          <xs:enumeration value="MacroCommand" />
          <xs:enumeration value="Manipulation" />
          <xs:enumeration value="Show" />
          <xs:enumeration value="Plot" />
          <xs:enumeration value="Newfile" />
          <xs:enumeration value="Measure" />
          <xs:enumeration value="Input" />
          <xs:enumeration value="Celllib" />
          <xs:enumeration value="Filedesign" />
          <xs:enumeration value="Compress" />
          <xs:enumeration value="Reference" />
          <xs:enumeration value="Database" />
          <xs:enumeration value="Dimension" />
          <xs:enumeration value="Locate" />
          <xs:enumeration value="Tutorial" />
          <xs:enumeration value="WorkingSet" />
          <xs:enumeration value="List" />
          <xs:enumeration value="Undo" />
          <xs:enumeration value="SubProcess" />
          <xs:enumeration value="ViewParam" />
          <xs:enumeration value="ViewImmediate" />
          <xs:enumeration value="WindowManager" />
          <xs:enumeration value="DialogManager" />
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="CommandWord" type="xs:string" />
  </xs:complexType>
  <xs:element name="KeyinTree" type="KeyinTree">
  </xs:element>
  <xs:complexType name="KeyinTree">
    <xs:sequence>
      <xs:element name="RootKeyinTable" type="KeyinTable" maxOccurs="1" minOccurs="1">
      </xs:element>
      <xs:element name="SubKeyinTables" minOccurs="0" maxOccurs="1">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="KeyinTable" type="KeyinTable" maxOccurs="unbounded" minOccurs="1" />
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:element name="KeyinHandlers" type="KeyinHandlers" />
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="KeyinTable">
    <xs:sequence>
      <xs:element name="Keyword" type="Keyword" minOccurs="1" maxOccurs="32767" />
    </xs:sequence>
    <xs:attribute name="ID" type="xs:ID" />
  </xs:complexType>
  <xs:complexType name="KeyinHandlers">
    <xs:sequence>
      <xs:element name="KeyinHandler" minOccurs="1" maxOccurs="unbounded" type="KeyinHandler">
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="KeyinHandler">
    <xs:attribute name="Keyin" type="xs:string" use="required" />
    <xs:attribute name="Function" type="xs:string" use="required" />
  </xs:complexType>
</xs:schema>